package com.baichang.taoshunda.dao.impl;

import org.springframework.stereotype.Repository;

import com.baichang.framework.dao.impl.BaseDaoImpl;
import com.baichang.taoshunda.dao.BackgroundImageDao;
import com.baichang.taoshunda.entity.BackgroundImage;

import java.util.List;
import java.util.Map;

@Repository
public class BackgroundImageDaoImpl extends BaseDaoImpl<BackgroundImage> implements BackgroundImageDao {

    @Override
    public List<Map<String, Object>> findBackGroundImageList(Integer userId, Integer nowPage, Integer pageSize) {
        String sql = "SELECT * FROM t_background_image WHERE user_id=0 OR user_id=?";
        return listForMapList(sql, nowPage, pageSize, userId);
    }

    /**
     *
     * @return
     */
    @Override
    public List<Map<String, Object>> queryImage() {
        String sql = "SELECT * FROM t_background_image WHERE user_id=0";
        return queryForBeanList(sql);
    }
}